import { createApp } from 'vue'
//ElementPlus
import ElementPlus from 'element-plus'// 加载 element
import zhCn from 'element-plus/lib/locale/lang/zh-cn'//中文化element
import 'element-plus/dist/index.css'
import * as Icons from "@element-plus/icons-vue";// element icons
import "@/styles/element.scss";// custom element css
// 全局样式
import '@/styles/common.scss'
import '@/styles/reset.scss'
// font css
import "@/assets/fonts/font.scss";
// iconfont css
import "@/assets/iconfont/iconfont.scss";
//svg加载器
import 'virtual:svg-icons-register'
// 加载 store
import pinia from '@/stores'
// 加载路由配置
import router from './routers'
import App from './App.vue'
import directives from "@/directives/index";// custom directives
// errorHandler
// import errorHandler from "@/utils/errorHandler";
// vue i18n
import I18n from "@/languages/index";
const app = createApp(App)
// 全局注册 element Icons 
Object.keys(Icons).forEach(key => {
  app.component(key, Icons[key as keyof typeof Icons]);
});
// app.config.errorHandler = errorHandler;
app
  .use(pinia)
  .use(router)
  .use(directives)
  .use(ElementPlus, {
    locale: zhCn,
  }).use(I18n)
  .mount('#app')
